namespace SmartSoft.Invoices
{
    using SmartSoft;
    using SmartSoft.Controls;
    using SmartSoft.Controls.ChildGridControls;
    using SmartSoft.ADP;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class FormCTNXViewer : FormHistoryViewer
    {
        private NumericColumn Column1;
        private DataGridViewTextBoxColumn Column10;
        private OptionColumn Column11;
        private SearchColumn Column12;
        private SearchColumn Column13;
        private SearchColumn Column14;
        private SearchColumn Column15;
        private SearchColumn Column16;
        private SearchColumn Column17;
        private DateColumn Column18;
        private NumericColumn Column19;
        private DataGridViewTextBoxColumn Column2;
        private NumericColumn Column20;
        private NumericColumn Column21;
        private NumericColumn Column22;
        private NumericColumn Column23;
        private NumericColumn Column24;
        private SearchColumn Column9;
        private IContainer components;
        private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
        private GridDetail grdDetail;
        public GridDetail grdSubDetail;
        private LabelControl lblDesc_EN;
        private LabelControl lblDia_Chi;
        private LabelControl lblDien_Giai;
        private LabelControl lblMa_Bp;
        private LabelControl lblMa_Dt;
        private LabelControl lblMa_Hd;
        private LabelControl lblMa_KhoN;
        private LabelControl lblMa_Km;
        private LabelControl lblMa_Nx;
        private LabelControl lblMa_Tte;
        private LabelControl lblOng_Ba;
        private LabelControl lblTTien_Nt0;
        private CTNXDataAccess oMethod = new CTNXDataAccess();
        private SearchColumn searchColumn1;
        private SearchColumn searchColumn2;
        private DataGridViewTextBoxColumn searchColumn3;
        private NumericColumn searchColumn4;
        private NumericColumn searchColumn5;
        private OptionColumn searchColumn6;
        private TextControl txtDesc_EN;
        private TextControl txtDia_Chi;
        private TextControl txtDien_Giai;
        private TextSearch txtMa_Bp;
        private TextSearch txtMa_Dt;
        private TextSearch txtMa_Hd;
        private TextSearch txtMa_KhoN;
        private TextSearch txtMa_Km;
        private TextSearch txtMa_Nx;
        private TextOption txtMa_Tte;
        private TextControl txtOng_Ba;
        private TextControl txtTen_Bp;
        private TextControl txtTen_Dt;
        private TextControl txtTen_Hd;
        private TextControl txtTen_KhoN;
        private TextControl txtTen_Km;
        private TextControl txtTen_Nx;
        private TextNumeric txtTTien_Nt0;
        private TextNumeric txtTy_Gia;

        public FormCTNXViewer()
        {
            this.InitializeComponent();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            //ComponentResourceManager manager = new ComponentResourceManager(typeof(FormCTNXViewer));
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            DataGridViewCellStyle style2 = new DataGridViewCellStyle();
            DataGridViewCellStyle style3 = new DataGridViewCellStyle();
            DataGridViewCellStyle style4 = new DataGridViewCellStyle();
            DataGridViewCellStyle style5 = new DataGridViewCellStyle();
            DataGridViewCellStyle style6 = new DataGridViewCellStyle();
            DataGridViewCellStyle style7 = new DataGridViewCellStyle();
            DataGridViewCellStyle style8 = new DataGridViewCellStyle();
            DataGridViewCellStyle style9 = new DataGridViewCellStyle();
            DataGridViewCellStyle style10 = new DataGridViewCellStyle();
            DataGridViewCellStyle style11 = new DataGridViewCellStyle();
            DataGridViewCellStyle style12 = new DataGridViewCellStyle();
            DataGridViewCellStyle style13 = new DataGridViewCellStyle();
            DataGridViewCellStyle style14 = new DataGridViewCellStyle();
            DataGridViewCellStyle style15 = new DataGridViewCellStyle();
            DataGridViewCellStyle style16 = new DataGridViewCellStyle();
            DataGridViewCellStyle style17 = new DataGridViewCellStyle();
            DataGridViewCellStyle style18 = new DataGridViewCellStyle();
            DataGridViewCellStyle style19 = new DataGridViewCellStyle();
            DataGridViewCellStyle style20 = new DataGridViewCellStyle();
            DataGridViewCellStyle style21 = new DataGridViewCellStyle();
            this.txtDesc_EN = new TextControl();
            this.txtDien_Giai = new TextControl();
            this.txtTen_Hd = new TextControl();
            this.txtTen_Bp = new TextControl();
            this.lblDesc_EN = new LabelControl();
            this.lblDien_Giai = new LabelControl();
            this.txtMa_Hd = new TextSearch();
            this.lblMa_Hd = new LabelControl();
            this.txtMa_Bp = new TextSearch();
            this.lblMa_Bp = new LabelControl();
            this.txtMa_Tte = new TextOption();
            this.txtTy_Gia = new TextNumeric();
            this.txtDia_Chi = new TextControl();
            this.txtOng_Ba = new TextControl();
            this.txtTen_Dt = new TextControl();
            this.lblMa_Tte = new LabelControl();
            this.txtMa_Dt = new TextSearch();
            this.lblDia_Chi = new LabelControl();
            this.lblOng_Ba = new LabelControl();
            this.lblMa_Dt = new LabelControl();
            this.txtTTien_Nt0 = new TextNumeric();
            this.lblTTien_Nt0 = new LabelControl();
            this.lblMa_Km = new LabelControl();
            this.txtMa_Km = new TextSearch();
            this.txtTen_Km = new TextControl();
            this.lblMa_Nx = new LabelControl();
            this.txtMa_Nx = new TextSearch();
            this.txtTen_Nx = new TextControl();
            this.lblMa_KhoN = new LabelControl();
            this.grdDetail = new GridDetail();
            this.Column9 = new SearchColumn();
            this.Column10 = new DataGridViewTextBoxColumn();
            this.Column11 = new OptionColumn();
            this.Column12 = new SearchColumn();
            this.Column13 = new SearchColumn();
            this.Column14 = new SearchColumn();
            this.Column15 = new SearchColumn();
            this.Column16 = new SearchColumn();
            this.Column2 = new DataGridViewTextBoxColumn();
            this.Column17 = new SearchColumn();
            this.Column18 = new DateColumn();
            this.Column19 = new NumericColumn();
            this.Column20 = new NumericColumn();
            this.Column21 = new NumericColumn();
            this.Column22 = new NumericColumn();
            this.Column23 = new NumericColumn();
            this.Column24 = new NumericColumn();
            this.grdSubDetail = new GridDetail();
            this.dataGridViewTextBoxColumn1 = new DataGridViewTextBoxColumn();
            this.searchColumn3 = new DataGridViewTextBoxColumn();
            this.Column1 = new NumericColumn();
            this.searchColumn4 = new NumericColumn();
            this.searchColumn5 = new NumericColumn();
            this.searchColumn6 = new OptionColumn();
            this.searchColumn1 = new SearchColumn();
            this.searchColumn2 = new SearchColumn();
            this.txtMa_KhoN = new TextSearch();
            this.txtTen_KhoN = new TextControl();
            ((ISupportInitialize) this.grdDetail).BeginInit();
            ((ISupportInitialize) this.grdSubDetail).BeginInit();
            base.SuspendLayout();
            base.txtMa_Loai3.TabIndex = 0x13;
            base.txtMa_Loai2.TabIndex = 0x12;
            base.txtNgay_Ct.TabIndex = 1;
            base.txtNgay_Ps.TabIndex = 0;
            base.txtSo_Ct.TabIndex = 2;
            this.txtDesc_EN.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.txtDesc_EN.CheckTextSearched = false;
            this.txtDesc_EN.DisabledForeColor = Color.Blue;
            this.txtDesc_EN.Font = new Font("Arial", 8.25f);
            this.txtDesc_EN.Location = new Point(0x1e7, 0x85);
            this.txtDesc_EN.MaxLength = 0xfe;
            this.txtDesc_EN.Name = "txtDesc_EN";
            this.txtDesc_EN.OldValue = null;
            this.txtDesc_EN.ReadOnly = true;
            this.txtDesc_EN.Size = new Size(0x127, 20);
            this.txtDesc_EN.TabIndex = 11;
            this.txtDesc_EN.UserTextLength = AppInstance.TextControlLength.InvoiceDescription;
//            this.txtDesc_EN.Value = null;//manager.GetObject("txtDesc_EN.Value");
            this.txtDien_Giai.CheckTextSearched = false;
            this.txtDien_Giai.DisabledForeColor = Color.Blue;
            this.txtDien_Giai.Font = new Font("Arial", 8.25f);
            this.txtDien_Giai.Location = new Point(0x63, 0x85);
            this.txtDien_Giai.MaxLength = 0xfe;
            this.txtDien_Giai.Name = "txtDien_Giai";
            this.txtDien_Giai.OldValue = null;
            this.txtDien_Giai.ReadOnly = true;
            this.txtDien_Giai.Size = new Size(0x128, 20);
            this.txtDien_Giai.TabIndex = 10;
            this.txtDien_Giai.UserTextLength = AppInstance.TextControlLength.InvoiceDescription;
//            this.txtDien_Giai.Value = null;//manager.GetObject("txtDien_Giai.Value");
            this.txtTen_Hd.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.txtTen_Hd.BackColor = SystemColors.Control;
            this.txtTen_Hd.BorderStyle = BorderStyle.None;
            this.txtTen_Hd.CheckTextSearched = false;
            this.txtTen_Hd.DisabledForeColor = Color.Blue;
            this.txtTen_Hd.Enabled = false;
            this.txtTen_Hd.Font = new Font("Arial", 8.25f);
            this.txtTen_Hd.ForeColor = Color.Blue;
            this.txtTen_Hd.Location = new Point(0xdf, 0x49);
            this.txtTen_Hd.Name = "txtTen_Hd";
            this.txtTen_Hd.OldValue = null;
            this.txtTen_Hd.Size = new Size(0x22f, 13);
            this.txtTen_Hd.TabIndex = 0x56;
//            this.txtTen_Hd.Value = null;//manager.GetObject("txtTen_Hd.Value");
            this.txtTen_Bp.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.txtTen_Bp.BackColor = SystemColors.Control;
            this.txtTen_Bp.BorderStyle = BorderStyle.None;
            this.txtTen_Bp.CheckTextSearched = false;
            this.txtTen_Bp.DisabledForeColor = Color.Blue;
            this.txtTen_Bp.Enabled = false;
            this.txtTen_Bp.Font = new Font("Arial", 8.25f);
            this.txtTen_Bp.ForeColor = Color.Blue;
            this.txtTen_Bp.Location = new Point(0xdf, 0x34);
            this.txtTen_Bp.Name = "txtTen_Bp";
            this.txtTen_Bp.OldValue = null;
            this.txtTen_Bp.Size = new Size(0x22f, 13);
            this.txtTen_Bp.TabIndex = 0x57;
//            this.txtTen_Bp.Value = null;//manager.GetObject("txtTen_Bp.Value");
            this.lblDesc_EN.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.lblDesc_EN.AutoSize = true;
            this.lblDesc_EN.Font = new Font("Arial", 8.25f);
            this.lblDesc_EN.Location = new Point(410, 0x88);
            this.lblDesc_EN.Name = "lblDesc_EN";
            this.lblDesc_EN.Size = new Size(0x47, 14);
            this.lblDesc_EN.TabIndex = 80;
            this.lblDesc_EN.Text = "Diễn giải (EN)";
            this.lblDien_Giai.AutoSize = true;
            this.lblDien_Giai.Font = new Font("Arial", 8.25f);
            this.lblDien_Giai.Location = new Point(12, 0x88);
            this.lblDien_Giai.Name = "lblDien_Giai";
            this.lblDien_Giai.Size = new Size(0x49, 14);
            this.lblDien_Giai.TabIndex = 0x51;
            this.lblDien_Giai.Text = "Diễn giải (VN)";
            this.txtMa_Hd.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Hd.CheckTextSearched = false;
            this.txtMa_Hd.DisabledForeColor = Color.Empty;
            this.txtMa_Hd.EmptyIsValid = true;
            this.txtMa_Hd.FieldDisplay = "Ten_Hd";
            this.txtMa_Hd.Font = new Font("Arial", 8.25f);
            this.txtMa_Hd.FoundIsValid = true;
            this.txtMa_Hd.Location = new Point(0x63, 70);
            this.txtMa_Hd.MaxLength = 0x20;
            this.txtMa_Hd.Name = "txtMa_Hd";
            this.txtMa_Hd.OldValue = null;
            this.txtMa_Hd.ReadOnly = true;
            this.txtMa_Hd.Size = new Size(0x76, 20);
            this.txtMa_Hd.TabIndex = 6;
            this.txtMa_Hd.TableName = "DMHD";
            this.txtMa_Hd.TextDisplay = this.txtTen_Hd;
            this.txtMa_Hd.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtMa_Hd.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtMa_Hd.Value = null;//manager.GetObject("txtMa_Hd.Value");
            this.lblMa_Hd.AutoSize = true;
            this.lblMa_Hd.Font = new Font("Arial", 8.25f);
            this.lblMa_Hd.Location = new Point(12, 0x49);
            this.lblMa_Hd.Name = "lblMa_Hd";
            this.lblMa_Hd.Size = new Size(0x36, 14);
            this.lblMa_Hd.TabIndex = 0x52;
            this.lblMa_Hd.Text = "Hợp đồng";
            this.txtMa_Bp.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Bp.CheckTextSearched = false;
            this.txtMa_Bp.DisabledForeColor = Color.Empty;
            this.txtMa_Bp.EmptyIsValid = true;
            this.txtMa_Bp.FieldDisplay = "Ten_Bp";
            this.txtMa_Bp.Font = new Font("Arial", 8.25f);
            this.txtMa_Bp.FoundIsValid = true;
            this.txtMa_Bp.Location = new Point(0x63, 0x31);
            this.txtMa_Bp.MaxLength = 0x20;
            this.txtMa_Bp.Name = "txtMa_Bp";
            this.txtMa_Bp.OldValue = null;
            this.txtMa_Bp.ReadOnly = true;
            this.txtMa_Bp.Size = new Size(0x76, 20);
            this.txtMa_Bp.TabIndex = 5;
            this.txtMa_Bp.TableName = "DMBP";
            this.txtMa_Bp.TextDisplay = this.txtTen_Bp;
            this.txtMa_Bp.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtMa_Bp.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtMa_Bp.Value = null;//manager.GetObject("txtMa_Bp.Value");
            this.lblMa_Bp.AutoSize = true;
            this.lblMa_Bp.Font = new Font("Arial", 8.25f);
            this.lblMa_Bp.Location = new Point(12, 0x34);
            this.lblMa_Bp.Name = "lblMa_Bp";
            this.lblMa_Bp.Size = new Size(0x2f, 14);
            this.lblMa_Bp.TabIndex = 0x53;
            this.lblMa_Bp.Text = "Bộ phận";
            this.txtMa_Tte.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.txtMa_Tte.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Tte.CheckTextSearched = false;
            this.txtMa_Tte.DisabledForeColor = Color.Blue;
            this.txtMa_Tte.Font = new Font("Arial", 8.25f);
            this.txtMa_Tte.InputMask = "USD,VND";
            this.txtMa_Tte.Location = new Point(0x2b9, 0x1c);
            this.txtMa_Tte.Name = "txtMa_Tte";
            this.txtMa_Tte.OldValue = null;
            this.txtMa_Tte.ReadOnly = true;
            this.txtMa_Tte.Size = new Size(0x1c, 20);
            this.txtMa_Tte.TabIndex = 3;
            this.txtMa_Tte.Text = "USD";
            this.txtMa_Tte.Value = "USD";
            this.txtTy_Gia.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.txtTy_Gia.BackColor = Color.White;
            this.txtTy_Gia.DisabledBackColor = Color.Empty;
            this.txtTy_Gia.Font = new Font("Arial", 8.25f);
            this.txtTy_Gia.ForeColor = Color.Black;
            this.txtTy_Gia.Location = new Point(0x2d4, 0x1c);
            this.txtTy_Gia.Name = "txtTy_Gia";
            int[] bits = new int[4];
            this.txtTy_Gia.NumericValue = new decimal(bits);
            this.txtTy_Gia.OldValue = null;
            this.txtTy_Gia.ReadOnly = true;
            this.txtTy_Gia.Size = new Size(0x3a, 20);
            this.txtTy_Gia.TabIndex = 4;
            this.txtTy_Gia.TextAlign = HorizontalAlignment.Right;
            this.txtTy_Gia.UserTextNumericFormat = AppInstance.TextNumericFormat.ExchangeRate;
//            this.txtTy_Gia.Value = null;//manager.GetObject("txtTy_Gia.Value");
            this.txtDia_Chi.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.txtDia_Chi.CheckTextSearched = false;
            this.txtDia_Chi.DisabledForeColor = Color.Blue;
            this.txtDia_Chi.Font = new Font("Arial", 8.25f);
            this.txtDia_Chi.Location = new Point(0x1e7, 0x70);
            this.txtDia_Chi.MaxLength = 0x80;
            this.txtDia_Chi.Name = "txtDia_Chi";
            this.txtDia_Chi.OldValue = null;
            this.txtDia_Chi.ReadOnly = true;
            this.txtDia_Chi.Size = new Size(0x127, 20);
            this.txtDia_Chi.TabIndex = 9;
            this.txtDia_Chi.UserTextLength = AppInstance.TextControlLength.ItemDescription;
//            this.txtDia_Chi.Value = null;//manager.GetObject("txtDia_Chi.Value");
            this.txtOng_Ba.CheckTextSearched = false;
            this.txtOng_Ba.DisabledForeColor = Color.Blue;
            this.txtOng_Ba.Font = new Font("Arial", 8.25f);
            this.txtOng_Ba.Location = new Point(0x63, 0x70);
            this.txtOng_Ba.MaxLength = 0x80;
            this.txtOng_Ba.Name = "txtOng_Ba";
            this.txtOng_Ba.OldValue = null;
            this.txtOng_Ba.ReadOnly = true;
            this.txtOng_Ba.Size = new Size(0x128, 20);
            this.txtOng_Ba.TabIndex = 8;
            this.txtOng_Ba.UserTextLength = AppInstance.TextControlLength.ItemDescription;
//            this.txtOng_Ba.Value = null;//manager.GetObject("txtOng_Ba.Value");
            this.txtTen_Dt.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.txtTen_Dt.BackColor = SystemColors.Control;
            this.txtTen_Dt.BorderStyle = BorderStyle.None;
            this.txtTen_Dt.CheckTextSearched = false;
            this.txtTen_Dt.DisabledForeColor = Color.Blue;
            this.txtTen_Dt.Enabled = false;
            this.txtTen_Dt.Font = new Font("Arial", 8.25f);
            this.txtTen_Dt.ForeColor = Color.Blue;
            this.txtTen_Dt.Location = new Point(0xdf, 0x5e);
            this.txtTen_Dt.Name = "txtTen_Dt";
            this.txtTen_Dt.OldValue = null;
            this.txtTen_Dt.Size = new Size(0x22f, 13);
            this.txtTen_Dt.TabIndex = 0x61;
//            this.txtTen_Dt.Value = null;//manager.GetObject("txtTen_Dt.Value");
            this.lblMa_Tte.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.lblMa_Tte.AutoSize = true;
            this.lblMa_Tte.Font = new Font("Arial", 8.25f);
            this.lblMa_Tte.Location = new Point(0x28c, 0x1f);
            this.lblMa_Tte.Name = "lblMa_Tte";
            this.lblMa_Tte.Size = new Size(0x27, 14);
            this.lblMa_Tte.TabIndex = 0x5d;
            this.lblMa_Tte.Text = "Tiền tệ";
            this.txtMa_Dt.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Dt.CheckTextSearched = false;
            this.txtMa_Dt.DisabledForeColor = Color.Empty;
            this.txtMa_Dt.FieldDisplay = "Ten_Dt";
            this.txtMa_Dt.FirstFilter = "Is_Stop = '1'";
            this.txtMa_Dt.Font = new Font("Arial", 8.25f);
            this.txtMa_Dt.Location = new Point(0x63, 0x5b);
            this.txtMa_Dt.MaxLength = 0x20;
            this.txtMa_Dt.Name = "txtMa_Dt";
            this.txtMa_Dt.OldValue = null;
            this.txtMa_Dt.ReadOnly = true;
            this.txtMa_Dt.Size = new Size(0x76, 20);
            this.txtMa_Dt.TabIndex = 7;
            this.txtMa_Dt.TableName = "DMDT";
            this.txtMa_Dt.TextDisplay = this.txtTen_Dt;
            this.txtMa_Dt.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtMa_Dt.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtMa_Dt.Value = null;//manager.GetObject("txtMa_Dt.Value");
            this.lblDia_Chi.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.lblDia_Chi.AutoSize = true;
            this.lblDia_Chi.Font = new Font("Arial", 8.25f);
            this.lblDia_Chi.Location = new Point(0x1b9, 0x73);
            this.lblDia_Chi.Name = "lblDia_Chi";
            this.lblDia_Chi.Size = new Size(40, 14);
            this.lblDia_Chi.TabIndex = 0x5f;
            this.lblDia_Chi.Text = "Địa chỉ";
            this.lblOng_Ba.AutoSize = true;
            this.lblOng_Ba.Font = new Font("Arial", 8.25f);
            this.lblOng_Ba.Location = new Point(12, 0x73);
            this.lblOng_Ba.Name = "lblOng_Ba";
            this.lblOng_Ba.Size = new Size(0x2a, 14);
            this.lblOng_Ba.TabIndex = 0x60;
            this.lblOng_Ba.Text = "\x00d4ng b\x00e0";
            this.lblMa_Dt.AutoSize = true;
            this.lblMa_Dt.Font = new Font("Arial", 8.25f);
            this.lblMa_Dt.Location = new Point(12, 0x5e);
            this.lblMa_Dt.Name = "lblMa_Dt";
            this.lblMa_Dt.Size = new Size(0x37, 14);
            this.lblMa_Dt.TabIndex = 0x5e;
            this.lblMa_Dt.Text = "Đối tượng";
            this.txtTTien_Nt0.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.txtTTien_Nt0.BackColor = Color.White;
            this.txtTTien_Nt0.Enabled = false;
            this.txtTTien_Nt0.Font = new Font("Arial", 8.25f);
            this.txtTTien_Nt0.ForeColor = Color.Black;
            this.txtTTien_Nt0.Location = new Point(0x2a2, 0x1e8);
            this.txtTTien_Nt0.Name = "txtTTien_Nt0";
            int[] numArray2 = new int[4];
            this.txtTTien_Nt0.NumericValue = new decimal(numArray2);
            this.txtTTien_Nt0.OldValue = null;
            this.txtTTien_Nt0.Size = new Size(0x6c, 20);
            this.txtTTien_Nt0.TabIndex = 0x1d;
            this.txtTTien_Nt0.TextAlign = HorizontalAlignment.Right;
            this.txtTTien_Nt0.UserTextNumericFormat = AppInstance.TextNumericFormat.ForeignAmount;
//            this.txtTTien_Nt0.Value = null;//manager.GetObject("txtTTien_Nt0.Value");
            this.lblTTien_Nt0.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.lblTTien_Nt0.AutoSize = true;
            this.lblTTien_Nt0.Font = new Font("Arial", 8.25f);
            this.lblTTien_Nt0.Location = new Point(0x269, 0x1eb);
            this.lblTTien_Nt0.Name = "lblTTien_Nt0";
            this.lblTTien_Nt0.Size = new Size(0x33, 14);
            this.lblTTien_Nt0.TabIndex = 0x65;
            this.lblTTien_Nt0.Text = "Tổng tiền";
            this.lblMa_Km.AutoSize = true;
            this.lblMa_Km.Font = new Font("Arial", 8.25f);
            this.lblMa_Km.Location = new Point(12, 0x9d);
            this.lblMa_Km.Name = "lblMa_Km";
            this.lblMa_Km.Size = new Size(0x3d, 14);
            this.lblMa_Km.TabIndex = 0x53;
            this.lblMa_Km.Text = "Khoản mục";
            this.txtMa_Km.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Km.CheckTextSearched = false;
            this.txtMa_Km.DisabledForeColor = Color.Empty;
            this.txtMa_Km.EmptyIsValid = true;
            this.txtMa_Km.FieldDisplay = "Ten_Km";
            this.txtMa_Km.Font = new Font("Arial", 8.25f);
            this.txtMa_Km.FoundIsValid = true;
            this.txtMa_Km.Location = new Point(0x63, 0x9a);
            this.txtMa_Km.MaxLength = 0x20;
            this.txtMa_Km.Name = "txtMa_Km";
            this.txtMa_Km.OldValue = null;
            this.txtMa_Km.ReadOnly = true;
            this.txtMa_Km.Size = new Size(0x76, 20);
            this.txtMa_Km.TabIndex = 12;
            this.txtMa_Km.TableName = "DMKM";
            this.txtMa_Km.TextDisplay = this.txtTen_Km;
            this.txtMa_Km.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtMa_Km.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtMa_Km.Value = null;//manager.GetObject("txtMa_Km.Value");
            this.txtTen_Km.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.txtTen_Km.BackColor = SystemColors.Control;
            this.txtTen_Km.BorderStyle = BorderStyle.None;
            this.txtTen_Km.CheckTextSearched = false;
            this.txtTen_Km.DisabledForeColor = Color.Blue;
            this.txtTen_Km.Enabled = false;
            this.txtTen_Km.Font = new Font("Arial", 8.25f);
            this.txtTen_Km.ForeColor = Color.Blue;
            this.txtTen_Km.Location = new Point(0xdf, 0x9d);
            this.txtTen_Km.Name = "txtTen_Km";
            this.txtTen_Km.OldValue = null;
            this.txtTen_Km.Size = new Size(0x22f, 13);
            this.txtTen_Km.TabIndex = 0x57;
//            this.txtTen_Km.Value = null;//manager.GetObject("txtTen_Km.Value");
            this.lblMa_Nx.AutoSize = true;
            this.lblMa_Nx.Font = new Font("Arial", 8.25f);
            this.lblMa_Nx.Location = new Point(12, 0xb2);
            this.lblMa_Nx.Name = "lblMa_Nx";
            this.lblMa_Nx.Size = new Size(0x48, 14);
            this.lblMa_Nx.TabIndex = 0x52;
            this.lblMa_Nx.Text = "Mã nhập xuất";
            this.txtMa_Nx.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_Nx.CheckTextSearched = false;
            this.txtMa_Nx.DisabledForeColor = Color.Empty;
            this.txtMa_Nx.FieldDisplay = "Ten_Nx";
            this.txtMa_Nx.Font = new Font("Arial", 8.25f);
            this.txtMa_Nx.FoundIsValid = true;
            this.txtMa_Nx.Location = new Point(0x63, 0xaf);
            this.txtMa_Nx.MaxLength = 0x20;
            this.txtMa_Nx.Name = "txtMa_Nx";
            this.txtMa_Nx.OldValue = null;
            this.txtMa_Nx.ReadOnly = true;
            this.txtMa_Nx.Size = new Size(0x76, 20);
            this.txtMa_Nx.TabIndex = 13;
            this.txtMa_Nx.TableName = "DMNX";
            this.txtMa_Nx.TextDisplay = this.txtTen_Nx;
            this.txtMa_Nx.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtMa_Nx.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtMa_Nx.Value = null;//manager.GetObject("txtMa_Nx.Value");
            this.txtTen_Nx.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            this.txtTen_Nx.BackColor = SystemColors.Control;
            this.txtTen_Nx.BorderStyle = BorderStyle.None;
            this.txtTen_Nx.CheckTextSearched = false;
            this.txtTen_Nx.DisabledForeColor = Color.Blue;
            this.txtTen_Nx.Enabled = false;
            this.txtTen_Nx.Font = new Font("Arial", 8.25f);
            this.txtTen_Nx.ForeColor = Color.Blue;
            this.txtTen_Nx.Location = new Point(0xdf, 0xb2);
            this.txtTen_Nx.Name = "txtTen_Nx";
            this.txtTen_Nx.OldValue = null;
            this.txtTen_Nx.Size = new Size(0x22f, 13);
            this.txtTen_Nx.TabIndex = 0x56;
//            this.txtTen_Nx.Value = null;//manager.GetObject("txtTen_Nx.Value");
            this.lblMa_KhoN.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.lblMa_KhoN.AutoSize = true;
            this.lblMa_KhoN.Font = new Font("Arial", 8.25f);
            this.lblMa_KhoN.Location = new Point(12, 0x1eb);
            this.lblMa_KhoN.Name = "lblMa_KhoN";
            this.lblMa_KhoN.Size = new Size(0x35, 14);
            this.lblMa_KhoN.TabIndex = 0x63;
            this.lblMa_KhoN.Text = "Kho nhập";
            this.grdDetail.AllowUserToAddRows = false;
            this.grdDetail.AllowUserToDeleteRows = false;
            this.grdDetail.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.grdDetail.CheckAutoSize = true;
            this.grdDetail.CheckColor = false;
            this.grdDetail.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdDetail.Columns.AddRange(new DataGridViewColumn[] { 
                this.Column9, this.Column10, this.Column11, this.Column12, this.Column13, this.Column14, this.Column15, this.Column16, this.Column2, this.Column17, this.Column18, this.Column19, this.Column20, this.Column21, this.Column22, this.Column23, 
                this.Column24
             });
            this.grdDetail.Font = new Font("Arial", 8.25f);
            this.grdDetail.Location = new Point(0, 0xc9);
            this.grdDetail.Name = "grdDetail";
            this.grdDetail.Size = new Size(0x31a, 0x119);
            this.grdDetail.TabIndex = 14;
            this.Column9.DataPropertyName = "Ma_Vt";
            style.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column9.DefaultCellStyle = style;
            this.Column9.DestinationFields = "Ten_Vt, Dvt";
            this.Column9.DisabledForeColor = Color.Blue;
            this.Column9.EmptyIsValid = true;
            this.Column9.HeaderText = "Mã vật tư";
            this.Column9.Name = "Column9";
            this.Column9.ReadOnly = true;
            this.Column9.Resizable = DataGridViewTriState.True;
            this.Column9.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column9.SourceFields = "Ten_Vt, Dvt";
            this.Column9.TableName = "DMVT";
            this.Column9.Width = 0x26;
            this.Column10.DataPropertyName = "Ten_Vt";
            this.Column10.HeaderText = "Tên vật tư";
            this.Column10.Name = "Column10";
            this.Column10.ReadOnly = true;
            this.Column10.Width = 130;
            this.Column11.DataPropertyName = "Dvt";
            style2.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column11.DefaultCellStyle = style2;
            this.Column11.DisabledForeColor = Color.Blue;
            this.Column11.HeaderText = "Đvt";
            this.Column11.Name = "Column11";
            this.Column11.ReadOnly = true;
            this.Column11.Resizable = DataGridViewTriState.True;
            this.Column11.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column11.UserTextLength = AppInstance.TextControlLength.None;
            this.Column11.Width = 0x1c;
            this.Column12.DataPropertyName = "Ma_Kho";
            style3.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column12.DefaultCellStyle = style3;
            this.Column12.DestinationFields = "Ten_Kho";
            this.Column12.DisabledForeColor = Color.Blue;
            this.Column12.HeaderText = "Kho";
            this.Column12.Name = "Column12";
            this.Column12.ReadOnly = true;
            this.Column12.Resizable = DataGridViewTriState.True;
            this.Column12.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column12.SourceFields = "Ten_Kho";
            this.Column12.TableName = "DMKHO";
            this.Column12.Width = 0x26;
            this.Column13.DataPropertyName = "Ma_Bp";
            style4.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column13.DefaultCellStyle = style4;
            this.Column13.DestinationFields = "Ten_Bp";
            this.Column13.DisabledForeColor = Color.Blue;
            this.Column13.EmptyIsValid = true;
            this.Column13.HeaderText = "Bộ phận";
            this.Column13.Name = "Column13";
            this.Column13.ReadOnly = true;
            this.Column13.Resizable = DataGridViewTriState.True;
            this.Column13.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column13.SourceFields = "Ten_Bp";
            this.Column13.TableName = "DMBP";
            this.Column13.Width = 0x26;
            this.Column14.DataPropertyName = "Ma_Hd";
            style5.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column14.DefaultCellStyle = style5;
            this.Column14.DestinationFields = "Ten_Hd";
            this.Column14.DisabledForeColor = Color.Blue;
            this.Column14.EmptyIsValid = true;
            this.Column14.HeaderText = "Hợp đồng";
            this.Column14.Name = "Column14";
            this.Column14.ReadOnly = true;
            this.Column14.Resizable = DataGridViewTriState.True;
            this.Column14.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column14.SourceFields = "Ten_Hd";
            this.Column14.TableName = "DMHD";
            this.Column14.Width = 0x26;
            this.Column15.DataPropertyName = "Ma_Km";
            style6.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column15.DefaultCellStyle = style6;
            this.Column15.DestinationFields = "Ten_Km";
            this.Column15.DisabledForeColor = Color.Blue;
            this.Column15.EmptyIsValid = true;
            this.Column15.HeaderText = "Khoản mục";
            this.Column15.Name = "Column15";
            this.Column15.ReadOnly = true;
            this.Column15.Resizable = DataGridViewTriState.True;
            this.Column15.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column15.SourceFields = "Ten_Km";
            this.Column15.TableName = "DMKM";
            this.Column15.Width = 0x25;
            this.Column16.DataPropertyName = "Ma_Sp";
            style7.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column16.DefaultCellStyle = style7;
            this.Column16.DestinationFields = "Ten_Sp";
            this.Column16.DisabledForeColor = Color.Blue;
            this.Column16.EmptyIsValid = true;
            this.Column16.HeaderText = "Sản phẩm";
            this.Column16.Name = "Column16";
            this.Column16.ReadOnly = true;
            this.Column16.Resizable = DataGridViewTriState.True;
            this.Column16.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column16.SourceFields = "Ten_Sp";
            this.Column16.TableName = "DMSP";
            this.Column16.Width = 0x26;
            this.Column2.DataPropertyName = "Ma_Yt";
            this.Column2.HeaderText = "Yếu tố";
            this.Column2.Name = "Column2";
            this.Column2.Width = 0x26;
            this.Column17.DataPropertyName = "Lo_Hang";
            style8.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column17.DefaultCellStyle = style8;
            this.Column17.DisabledForeColor = Color.Blue;
            this.Column17.EmptyIsValid = true;
            this.Column17.HeaderText = "L\x00f4 hàng";
            this.Column17.Name = "Column17";
            this.Column17.ReadOnly = true;
            this.Column17.Resizable = DataGridViewTriState.True;
            this.Column17.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column17.TableName = "LOHANG";
            this.Column17.Width = 0x26;
            this.Column18.DataPropertyName = "Han_Dung";
            style9.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.Column18.DefaultCellStyle = style9;
            this.Column18.HeaderText = "Hạn d\x00f9ng";
            this.Column18.Name = "Column18";
            this.Column18.ReadOnly = true;
            this.Column18.Resizable = DataGridViewTriState.False;
            this.Column18.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column18.Width = 0x3e;
            this.Column19.DataPropertyName = "H_Luong";
            style10.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column19.DefaultCellStyle = style10;
            this.Column19.HeaderText = "H\x00e0m lượng";
            this.Column19.Name = "Column19";
            this.Column19.ReadOnly = true;
            this.Column19.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column19.UserTextNumericFormat = AppInstance.TextNumericFormat.Percent;
            this.Column19.Width = 0x1a;
            this.Column20.DataPropertyName = "Do_Am_PT";
            style11.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column20.DefaultCellStyle = style11;
            this.Column20.HeaderText = "Độ ẩm";
            this.Column20.Name = "Column20";
            this.Column20.ReadOnly = true;
            this.Column20.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column20.UserTextNumericFormat = AppInstance.TextNumericFormat.Percent;
            this.Column20.Width = 0x1a;
            this.Column21.DataPropertyName = "Do_Con_PT";
            style12.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column21.DefaultCellStyle = style12;
            this.Column21.HeaderText = "Độ cồn";
            this.Column21.Name = "Column21";
            this.Column21.ReadOnly = true;
            this.Column21.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column21.UserTextNumericFormat = AppInstance.TextNumericFormat.Percent;
            this.Column21.Width = 0x1a;
            this.Column22.DataPropertyName = "So_Luong9";
            style13.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column22.DefaultCellStyle = style13;
            this.Column22.HeaderText = "Số lượng";
            this.Column22.Name = "Column22";
            this.Column22.ReadOnly = true;
            this.Column22.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column22.UserTextNumericFormat = AppInstance.TextNumericFormat.Quantity;
            this.Column22.Width = 0x2d;
            this.Column22.ZeroIsValid = true;
            this.Column23.DataPropertyName = "Gia_Nt9";
            style14.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column23.DefaultCellStyle = style14;
            this.Column23.HeaderText = "Đơn giá";
            this.Column23.Name = "Column23";
            this.Column23.ReadOnly = true;
            this.Column23.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column23.UserTextNumericFormat = AppInstance.TextNumericFormat.ForeignPrice;
            this.Column23.Width = 50;
            this.Column23.ZeroIsValid = true;
            this.Column24.DataPropertyName = "Tien_Nt";
            style15.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column24.DefaultCellStyle = style15;
            this.Column24.HeaderText = "Thành tiền";
            this.Column24.Name = "Column24";
            this.Column24.ReadOnly = true;
            this.Column24.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column24.UserTextNumericFormat = AppInstance.TextNumericFormat.ForeignAmount;
            this.Column24.Width = 0x37;
            this.Column24.ZeroIsValid = true;
            this.grdSubDetail.AllowUserToAddRows = false;
            this.grdSubDetail.AllowUserToDeleteRows = false;
            this.grdSubDetail.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top;
            this.grdSubDetail.CheckAutoSize = true;
            this.grdSubDetail.CheckColor = false;
            this.grdSubDetail.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grdSubDetail.Columns.AddRange(new DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, this.searchColumn3, this.Column1, this.searchColumn4, this.searchColumn5, this.searchColumn6, this.searchColumn1, this.searchColumn2 });
            this.grdSubDetail.FirstColumnIndex = -1;
            this.grdSubDetail.Font = new Font("Arial", 8.25f);
            this.grdSubDetail.Location = new Point(0, 0xc9);
            this.grdSubDetail.Name = "grdSubDetail";
            this.grdSubDetail.Size = new Size(0x31a, 0x119);
            this.grdSubDetail.TabIndex = 15;
            this.grdSubDetail.Visible = false;
            this.dataGridViewTextBoxColumn1.DataPropertyName = "Ten_Vt";
            this.dataGridViewTextBoxColumn1.HeaderText = "Tên vật tư";
            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
            this.dataGridViewTextBoxColumn1.ReadOnly = true;
            this.dataGridViewTextBoxColumn1.Width = 0x15f;
            this.searchColumn3.DataPropertyName = "Dvt";
            this.searchColumn3.HeaderText = "Đvt";
            this.searchColumn3.Name = "searchColumn3";
            this.searchColumn3.ReadOnly = true;
            this.searchColumn3.Resizable = DataGridViewTriState.True;
            this.searchColumn3.Width = 40;
            this.Column1.DataPropertyName = "So_Luong9";
            style16.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.Column1.DefaultCellStyle = style16;
            this.Column1.HeaderText = "Số lượng";
            this.Column1.Name = "Column1";
            this.Column1.ReadOnly = true;
            this.Column1.SortMode = DataGridViewColumnSortMode.Automatic;
            this.Column1.UserTextNumericFormat = AppInstance.TextNumericFormat.Quantity;
            this.Column1.Width = 60;
            this.searchColumn4.DataPropertyName = "Gia_Nt9";
            style17.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.searchColumn4.DefaultCellStyle = style17;
            this.searchColumn4.HeaderText = "Đơn giá";
            this.searchColumn4.Name = "searchColumn4";
            this.searchColumn4.ReadOnly = true;
            this.searchColumn4.SortMode = DataGridViewColumnSortMode.Automatic;
            this.searchColumn4.UserTextNumericFormat = AppInstance.TextNumericFormat.ForeignPrice;
            this.searchColumn4.Width = 70;
            this.searchColumn5.DataPropertyName = "Tien_Nt";
            style18.Alignment = DataGridViewContentAlignment.MiddleRight;
            this.searchColumn5.DefaultCellStyle = style18;
            this.searchColumn5.HeaderText = "Thành tiền";
            this.searchColumn5.Name = "searchColumn5";
            this.searchColumn5.ReadOnly = true;
            this.searchColumn5.SortMode = DataGridViewColumnSortMode.Automatic;
            this.searchColumn5.UserTextNumericFormat = AppInstance.TextNumericFormat.ForeignAmount;
            this.searchColumn5.Width = 90;
            this.searchColumn6.DataPropertyName = "Gia_Tb_Tt";
            style19.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.searchColumn6.DefaultCellStyle = style19;
            this.searchColumn6.DisabledForeColor = Color.Blue;
            this.searchColumn6.HeaderText = "";
            this.searchColumn6.InputMask = "C,K";
            this.searchColumn6.Name = "searchColumn6";
            this.searchColumn6.ReadOnly = true;
            this.searchColumn6.Resizable = DataGridViewTriState.False;
            this.searchColumn6.SortMode = DataGridViewColumnSortMode.Automatic;
            this.searchColumn6.UserTextLength = AppInstance.TextControlLength.None;
            this.searchColumn6.Width = 20;
            this.searchColumn1.DataPropertyName = "Tk_No";
            style20.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.searchColumn1.DefaultCellStyle = style20;
            this.searchColumn1.DisabledForeColor = Color.Blue;
            this.searchColumn1.FirstFilter = "Loai_Tk = 'C'";
            this.searchColumn1.HeaderText = "Tk nợ";
            this.searchColumn1.Name = "searchColumn1";
            this.searchColumn1.ReadOnly = true;
            this.searchColumn1.SortMode = DataGridViewColumnSortMode.Automatic;
            this.searchColumn1.TableName = "DMTK";
            this.searchColumn1.Width = 60;
            this.searchColumn2.DataPropertyName = "Tk_Co";
            style21.Alignment = DataGridViewContentAlignment.MiddleLeft;
            this.searchColumn2.DefaultCellStyle = style21;
            this.searchColumn2.DisabledForeColor = Color.Blue;
            this.searchColumn2.FirstFilter = "Loai_Tk = 'C'";
            this.searchColumn2.HeaderText = "Tk có";
            this.searchColumn2.Name = "searchColumn2";
            this.searchColumn2.ReadOnly = true;
            this.searchColumn2.SortMode = DataGridViewColumnSortMode.Automatic;
            this.searchColumn2.TableName = "DMTK";
            this.searchColumn2.Width = 60;
            this.txtMa_KhoN.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtMa_KhoN.CharacterCasing = CharacterCasing.Upper;
            this.txtMa_KhoN.CheckTextSearched = false;
            this.txtMa_KhoN.DisabledForeColor = Color.Empty;
            this.txtMa_KhoN.FieldDisplay = "Ten_Kho";
            this.txtMa_KhoN.Font = new Font("Arial", 8.25f);
            this.txtMa_KhoN.FoundIsValid = true;
            this.txtMa_KhoN.Location = new Point(0x63, 0x1e8);
            this.txtMa_KhoN.MaxLength = 0x20;
            this.txtMa_KhoN.Name = "txtMa_KhoN";
            this.txtMa_KhoN.OldValue = null;
            this.txtMa_KhoN.ReadOnly = true;
            this.txtMa_KhoN.Size = new Size(0x76, 20);
            this.txtMa_KhoN.TabIndex = 0x10;
            this.txtMa_KhoN.TableName = "DMKHO";
            this.txtMa_KhoN.TextDisplay = this.txtTen_KhoN;
            this.txtMa_KhoN.UserTextLength = AppInstance.TextControlLength.ItemCode;
            this.txtMa_KhoN.UserTrimMode = AppInstance.TextControlTrimMode.All;
//            this.txtMa_KhoN.Value = null;//manager.GetObject("txtMa_KhoN.Value");
            this.txtTen_KhoN.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom;
            this.txtTen_KhoN.BackColor = SystemColors.Control;
            this.txtTen_KhoN.BorderStyle = BorderStyle.None;
            this.txtTen_KhoN.CheckTextSearched = false;
            this.txtTen_KhoN.DisabledForeColor = Color.Blue;
            this.txtTen_KhoN.Enabled = false;
            this.txtTen_KhoN.Font = new Font("Arial", 8.25f);
            this.txtTen_KhoN.ForeColor = Color.Blue;
            this.txtTen_KhoN.Location = new Point(0xdf, 0x1eb);
            this.txtTen_KhoN.Name = "txtTen_KhoN";
            this.txtTen_KhoN.OldValue = null;
            this.txtTen_KhoN.Size = new Size(0x14b, 13);
            this.txtTen_KhoN.TabIndex = 0x56;
//            this.txtTen_KhoN.Value = null;//manager.GetObject("txtTen_KhoN.Value");
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.ClientSize = new Size(0x31a, 0x214);
            base.Controls.Add(this.txtTTien_Nt0);
            base.Controls.Add(this.lblTTien_Nt0);
            base.Controls.Add(this.lblMa_KhoN);
            base.Controls.Add(this.txtMa_Tte);
            base.Controls.Add(this.txtTy_Gia);
            base.Controls.Add(this.txtDia_Chi);
            base.Controls.Add(this.txtOng_Ba);
            base.Controls.Add(this.txtTen_Dt);
            base.Controls.Add(this.lblMa_Tte);
            base.Controls.Add(this.txtMa_Dt);
            base.Controls.Add(this.lblDia_Chi);
            base.Controls.Add(this.lblOng_Ba);
            base.Controls.Add(this.lblMa_Dt);
            base.Controls.Add(this.txtDesc_EN);
            base.Controls.Add(this.txtDien_Giai);
            base.Controls.Add(this.txtTen_KhoN);
            base.Controls.Add(this.txtTen_Nx);
            base.Controls.Add(this.txtTen_Hd);
            base.Controls.Add(this.txtTen_Km);
            base.Controls.Add(this.txtTen_Bp);
            base.Controls.Add(this.lblDesc_EN);
            base.Controls.Add(this.lblDien_Giai);
            base.Controls.Add(this.txtMa_KhoN);
            base.Controls.Add(this.txtMa_Nx);
            base.Controls.Add(this.txtMa_Hd);
            base.Controls.Add(this.lblMa_Nx);
            base.Controls.Add(this.lblMa_Hd);
            base.Controls.Add(this.txtMa_Km);
            base.Controls.Add(this.lblMa_Km);
            base.Controls.Add(this.txtMa_Bp);
            base.Controls.Add(this.lblMa_Bp);
            base.Controls.Add(this.grdDetail);
            base.Controls.Add(this.grdSubDetail);
            base.Name = "FormCTNXViewer";
            base.Controls.SetChildIndex(this.grdSubDetail, 0);
            base.Controls.SetChildIndex(this.grdDetail, 0);
            base.Controls.SetChildIndex(base.lblPhan_Loai, 0);
            base.Controls.SetChildIndex(base.txtSo_Ct, 0);
            base.Controls.SetChildIndex(base.txtNgay_Ps, 0);
            base.Controls.SetChildIndex(base.txtNgay_Ct, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai1, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai2, 0);
            base.Controls.SetChildIndex(base.txtMa_Loai3, 0);
            base.Controls.SetChildIndex(this.lblMa_Bp, 0);
            base.Controls.SetChildIndex(this.txtMa_Bp, 0);
            base.Controls.SetChildIndex(this.lblMa_Km, 0);
            base.Controls.SetChildIndex(this.txtMa_Km, 0);
            base.Controls.SetChildIndex(this.lblMa_Hd, 0);
            base.Controls.SetChildIndex(this.lblMa_Nx, 0);
            base.Controls.SetChildIndex(this.txtMa_Hd, 0);
            base.Controls.SetChildIndex(this.txtMa_Nx, 0);
            base.Controls.SetChildIndex(this.txtMa_KhoN, 0);
            base.Controls.SetChildIndex(this.lblDien_Giai, 0);
            base.Controls.SetChildIndex(this.lblDesc_EN, 0);
            base.Controls.SetChildIndex(this.txtTen_Bp, 0);
            base.Controls.SetChildIndex(this.txtTen_Km, 0);
            base.Controls.SetChildIndex(this.txtTen_Hd, 0);
            base.Controls.SetChildIndex(this.txtTen_Nx, 0);
            base.Controls.SetChildIndex(this.txtTen_KhoN, 0);
            base.Controls.SetChildIndex(this.txtDien_Giai, 0);
            base.Controls.SetChildIndex(this.txtDesc_EN, 0);
            base.Controls.SetChildIndex(this.lblMa_Dt, 0);
            base.Controls.SetChildIndex(this.lblOng_Ba, 0);
            base.Controls.SetChildIndex(this.lblDia_Chi, 0);
            base.Controls.SetChildIndex(this.txtMa_Dt, 0);
            base.Controls.SetChildIndex(this.lblMa_Tte, 0);
            base.Controls.SetChildIndex(this.txtTen_Dt, 0);
            base.Controls.SetChildIndex(this.txtOng_Ba, 0);
            base.Controls.SetChildIndex(this.txtDia_Chi, 0);
            base.Controls.SetChildIndex(this.txtTy_Gia, 0);
            base.Controls.SetChildIndex(this.txtMa_Tte, 0);
            base.Controls.SetChildIndex(this.lblMa_KhoN, 0);
            base.Controls.SetChildIndex(this.lblTTien_Nt0, 0);
            base.Controls.SetChildIndex(this.txtTTien_Nt0, 0);
            ((ISupportInitialize) this.grdDetail).EndInit();
            ((ISupportInitialize) this.grdSubDetail).EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        internal override void OnResetControls()
        {
            base.DetailGridBrowser = this.grdDetail;
            base.DetailSubBrowser = this.grdSubDetail;
            int num = 0;
            if (base.SSInvoiceParameters.AllowDepartmentControl != 1)
            {
                num += this.txtMa_Hd.Top - this.txtMa_Bp.Top;
                this.lblMa_Bp.Visible = false;
                this.txtMa_Bp.Visible = false;
                this.txtTen_Bp.Visible = false;
            }
            if (base.SSInvoiceParameters.AllowContractControl != 1)
            {
                num += this.txtMa_Dt.Top - this.txtMa_Hd.Top;
                this.lblMa_Hd.Visible = false;
                this.txtMa_Hd.Visible = false;
                this.txtTen_Hd.Visible = false;
            }
            if (num != 0)
            {
                if (base.SSInvoiceParameters.AllowContractControl == 1)
                {
                    this.lblMa_Hd.Top -= num;
                    this.txtMa_Hd.Top -= num;
                    this.txtTen_Hd.Top -= num;
                }
                this.lblMa_Dt.Top -= num;
                this.txtMa_Dt.Top -= num;
                this.txtTen_Dt.Top -= num;
                this.lblOng_Ba.Top -= num;
                this.txtOng_Ba.Top -= num;
                this.lblDia_Chi.Top -= num;
                this.txtDia_Chi.Top -= num;
                this.lblDien_Giai.Top -= num;
                this.txtDien_Giai.Top -= num;
                this.lblDesc_EN.Top -= num;
                this.txtDesc_EN.Top -= num;
            }
            if (base.SSInvoiceParameters.AllowCategoryControl != 1)
            {
                num += this.txtMa_Nx.Top - this.txtMa_Km.Top;
                this.lblMa_Km.Visible = false;
                this.txtMa_Km.Visible = false;
                this.txtTen_Km.Visible = false;
            }
            else
            {
                this.lblMa_Km.Top -= num;
                this.txtMa_Km.Top -= num;
                this.txtTen_Km.Top -= num;
            }
            if (num != 0)
            {
                this.lblMa_Nx.Top -= num;
                this.txtMa_Nx.Top -= num;
                this.txtTen_Nx.Top -= num;
                this.grdDetail.Top -= num;
                this.grdDetail.Height += num;
                this.grdSubDetail.Top -= num;
                this.grdSubDetail.Height += num;
            }
            if (!base.SSInvoiceParameters.BilingualUsed)
            {
                this.lblDesc_EN.Visible = false;
                this.txtDesc_EN.Visible = false;
                this.txtDien_Giai.Width = (this.txtDesc_EN.Left + this.txtDesc_EN.Width) - this.txtDien_Giai.Left;
                this.txtDien_Giai.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
            }
            if (base.SSInvoiceParameters.AllowDepartmentControl != 2)
            {
                base.DetailGridBrowser.Columns[4].Visible = false;
            }
            if (base.SSInvoiceParameters.AllowContractControl != 2)
            {
                base.DetailGridBrowser.Columns[5].Visible = false;
            }
            if (base.SSInvoiceParameters.AllowCategoryControl != 2)
            {
                base.DetailGridBrowser.Columns[6].Visible = false;
            }
            if (!base.SSInvoiceParameters.AllowProductControl || (base.SSInvoiceParameters.InvoiceCode == "PNTP"))
            {
                base.DetailGridBrowser.Columns[7].Visible = false;
            }
            if (base.SSInvoiceParameters.InvoiceCode != "PNSP")
            {
                base.DetailGridBrowser.Columns[8].Visible = false;
            }
            if (!AppInstance.LotNumberCtrl)
            {
                base.DetailGridBrowser.Columns[9].Visible = false;
            }
            if (!AppInstance.DeadLineCtrl)
            {
                base.DetailGridBrowser.Columns[10].Visible = false;
            }
            if (!AppInstance.QualityCtrl)
            {
                base.DetailGridBrowser.Columns[11].Visible = false;
            }
            if (!AppInstance.DampCtrl)
            {
                base.DetailGridBrowser.Columns[12].Visible = false;
            }
            if (!AppInstance.AlcoholCtrl)
            {
                base.DetailGridBrowser.Columns[13].Visible = false;
            }
            if (base.SSInvoiceParameters.FreeFields <= 0)
            {
                num = base.txtMa_Loai1.Top - this.txtMa_KhoN.Top;
                this.lblMa_KhoN.Top += num;
                this.txtMa_KhoN.Top += num;
                this.txtTen_KhoN.Top += num;
                this.lblTTien_Nt0.Top += num;
                this.txtTTien_Nt0.Top += num;
                this.grdDetail.Height += num;
                this.grdSubDetail.Height += num;
            }
            if (base.SSInvoiceParameters.InvoiceCode != "PXDC")
            {
                this.lblMa_KhoN.Visible = false;
                this.txtMa_KhoN.Visible = false;
                this.txtTen_KhoN.Visible = false;
            }
            base.OnResetControls();
        }

        protected override void OnResize(EventArgs e)
        {
            base.OnResize(e);
            if (this.txtOng_Ba != null)
            {
                int num = base.ClientSize.Width - 0xcb;
                this.txtOng_Ba.Width = num / 2;
                this.txtDia_Chi.Left = (this.txtOng_Ba.Left + this.txtOng_Ba.Width) + 0x5c;
                this.txtDia_Chi.Width = num - this.txtOng_Ba.Width;
                this.lblDia_Chi.Left = (this.txtDia_Chi.Left - this.lblDia_Chi.Width) - 6;
                if ((base.SSInvoiceParameters != null) && base.SSInvoiceParameters.BilingualUsed)
                {
                    this.txtDien_Giai.Width = this.txtOng_Ba.Width;
                    this.txtDesc_EN.Left = this.txtDia_Chi.Left;
                    this.txtDesc_EN.Width = this.txtDia_Chi.Width;
                    this.lblDesc_EN.Left = (this.txtDesc_EN.Left - this.lblDesc_EN.Width) - 6;
                }
            }
        }

        internal override void OnShow()
        {
            base.OnShow();
            this.txtMa_Tte.Value = base.LocalMasterRow["Ma_Tte"];
            this.txtTy_Gia.Value = base.LocalMasterRow["Ty_Gia"];
            this.txtMa_Bp.Value = base.LocalMasterRow["Ma_Bp"];
            this.txtTen_Bp.Value = base.LocalMasterRow["Ten_Bp"];
            this.txtMa_Hd.Value = base.LocalMasterRow["Ma_Hd"];
            this.txtTen_Hd.Value = base.LocalMasterRow["Ten_Hd"];
            this.txtMa_Dt.Value = base.LocalMasterRow["Ma_Dt"];
            this.txtTen_Dt.Value = base.LocalMasterRow["Ten_Dt"];
            this.txtOng_Ba.Value = base.LocalMasterRow["Ong_Ba"];
            this.txtDia_Chi.Value = base.LocalMasterRow["Dia_Chi"];
            this.txtDien_Giai.Value = base.LocalMasterRow["Dien_Giai"];
            this.txtDesc_EN.Value = base.LocalMasterRow["Desc_EN"];
            this.txtMa_Km.Value = base.LocalMasterRow["Ma_Km"];
            this.txtTen_Km.Value = base.LocalMasterRow["Ten_Km"];
            this.txtMa_Nx.Value = base.LocalMasterRow["Ma_Nx"];
            this.txtTen_Nx.Value = base.LocalMasterRow["Ten_Nx"];
            this.txtMa_KhoN.Value = base.LocalMasterRow["Ma_KhoN"];
            this.txtTen_KhoN.Value = base.LocalMasterRow["Ten_KhoN"];
            this.txtTTien_Nt0.Value = base.LocalMasterRow["TTien_Nt0"];
        }
    }
}

